
<?php include_once 'common/header.php';  ?>
<!-- admin_main -->
<div class="admin_main">
	<!-- Admin_top end -->
	<?php include_once 'common/site_left.php';  ?>
	<!-- Admin_Left End -->
	<div class="admin_right">
		<div class="admin_right_title">
			<strong>栏目管理</strong> &gt;&gt;  添加友情链接
		</div>
		
		<div class="admin_right_info">
			<form action="/ychadmin/links/add/" method="post" id="linksForm" name="linksForm" enctype="multipart/form-data">
			<div class="admin_right_info_title"><h2>添加友情链接</h2></div>
			<ul>
				<li>
					<font color="red"><?php echo @validation_errors(); ?></font>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">类型：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<select id="type" name="type">
						<option value="0">--请选择--</option>
						<option value="1">友情链接</option>
						<option value="2">合作伙伴</option>
					</select>
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="typeTip"></div> </div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">URL：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="url" id="url" size="50"  value="<?php echo @set_value('url');?>" />
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="urlTip"></div> </div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">站点名称：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="webname" id="webname" size="50" value="<?php echo @set_value('webname');?>" />
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="webnameTip"></div></div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">logo图片：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="file" name="logoimg" id="logoimg" />
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="logoimgTip"></div></div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">排序：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="forder" id="forder" value="<?php echo @set_value('forder')?set_value('forder'):0;?>" />
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="forderTip"></div></div>
				</li>
				<li>
					<input type="submit" value="提交" />
				</li>
			</ul>
			</form>
			</div>
	</div>
<!-- Admin_Right End -->
</div>
<!-- admin_main end -->
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({formID:"linksForm",debug:false,submitOnce:true,
		onError:function(msg,obj,errorlist){
			$("#errorlist").empty();
			$.map(errorlist,function(msg){
				$("#errorlist").append("<li>" + msg + "</li>")
			});
			alert(msg);
		},
		submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...'
	});
	$("#url").formValidator({autoModify:true,onShow:"",onFocus:"标题在1-20个汉字之间",onCorrect:""}).inputValidator({min:1,max:100,onError:"标题不能为空,请确认"});
	$("#webname").formValidator({onShow:"",onFocus:"内容不能为空",onCorrect:""}).inputValidator({min:1,onError:"内容不能为空,请确认"});
});
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
</body>
</html>
